import React from 'react';
import { inject, observer } from 'mobx-react';
import { WeaTop, WeaRightMenu, WeaNewScroll, WeaTextarea, WeaAlertPage, WeaDatePicker, WeaCheckbox, WeaSelect, WeaUpload } from 'ecCom';
import { Button, Spin, Row, Col, Icon } from 'antd';
import Collapse from './collapse.js';
import { WeaLocaleProvider } from 'ecCom';
import moment from 'moment';
import SmsTempList from '../SmsTemplate/TempList';
import AlertModal from '../../public/AlertModal';
import ImportResult from './importResult';

const getLabel = WeaLocaleProvider.getLabel;

@inject('smsBatchImportStore')
@inject('smsTempStore')
@observer
class SmsBatchImport extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            fileTypeOptions: [
                { showname: getLabel(519188, 'Excel导入'), key: '1' },
                { showname: getLabel(519189, 'TXT导入'), key: '2' },
            ],
            receiverType: '1',
            filelist: [],
            excelfile: '',
            spinning: false,
            showAddBtn: true,
            tempText: '',
            showTemp: false,
            regularChk: 0,
            regularDateTime: moment().format('YYYY-MM-DD HH:mm'),
        };
    }
    componentDidMount() {
        const { smsBatchImportStore } = this.props;
        smsBatchImportStore.clearStatus();
        this.doInit(this.props);
    }

    componentWillReceiveProps(nextProps) {
    }

    componentWillUnmount() {
        // 组件卸载时一般清理一些状态
    }

    doInit(props) {
        const { smsBatchImportStore } = props;
        smsBatchImportStore.getBaseData();
        smsBatchImportStore.getOptions();
        this.setState({ regularDateTime: moment().format('YYYY-MM-DD HH:mm') });
    }

    checkTemp = (item) => {
        const { smsBatchImportStore } = this.props;
        this.refs.textArea.setValue(item.content);
    }

    doAdd = (e) => {
        const { smsTempStore: { showTempDataAndMsg } } = this.props;
        showTempDataAndMsg();
        e.stopPropagation();
    }

    openTempList = () => {
        const { smsBatchImportStore, smsTempStore } = this.props;
        smsTempStore.doLoading();
        smsBatchImportStore.openTempList();
    }

    showTemp = () => {
        this.setState({ showAddBtn: true });
        if (this.state.showTemp) {
            this.setState({ showTemp: false });
        } else {
            this.setState({ showTemp: true });
        }
    }
    saveTemp = () => {
        let value = this.state.tempText;
        const { smsBatchImportStore } = this.props;
        smsBatchImportStore.quickSaveTemp({ tempText: value });
        this.setState({ showAddBtn: true });
    }

    getCircle() {
        let style = {
            width: 20,
            height: 20,
            backgroundColor: '#D8D8D8',
            webkitBorderRadius: 10,
            mozBorderRadius: 10,
            msBorderRadius: 10,
            oBorderRadius: 10,
            borderRadius: 10,
            // paddingLeft: 6,
            textAlign: 'center',
        };
        return style;
    }

    getBatchImport = () => {
        const { smsBatchImportStore } = this.props;
        const { fileTypeOptions, receiverType, filelist, spinning } = this.state;
        const contentStyle = {
            display: this.state.showTemp ? 'block' : 'none',
        };
        const comStyle = {
            paddingLeft: '40px',
        };
        if (!this.state.showAddBtn) contentStyle['border-bottom'] = 0;
        let leftCol = 4,
rightCol = 10,
offset = 4,
titlecol = 4,
fieldcol = 10,
marginBottomValue = 6;
        return (
            <div className="smsBatch-import">
                <Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@i51cco`} spinning={spinning} >
                    <Collapse ecId={`${this && this.props && this.props.ecId || ''}_Collapse@u1pc5l`}
                      title={getLabel(81711, '基本信息')}
                      showGroup={true}
                    >
                        <div className="smsBatch-import-group">
                            <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@k9op5n`} className="group-smsBatchType" style={{ marginBottom: '10px' }}>
                                <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@zin76b`} offset={offset} span={leftCol} style={{ ...comStyle, lineHeight: '28px' }}>
                                    <span>{getLabel(519191, '导入选择')} :</span>
                                </Col>
                                <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@g62jup`} span={rightCol} style={{ marginLeft: '43px' }}>
                                    <WeaSelect ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@hsyoav`}
                                      options={fileTypeOptions}
                                      value={receiverType}
                                      detailtype={3}
                                      onChange={(value) => { this.clearInfo(); this.onChange(value, 'receiverType'); }}
                                    />
                                </Col>
                            </Row>
                            <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@r4ilk8`} className="group-download" style={{ marginBottom: '10px', lineHeight: '20px' }}>
                                <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@6yzrzw`} offset={offset} span={leftCol} style={{ ...comStyle }}>
                                    <span>{getLabel(519192, '下载模版')} :</span>
                                </Col>
                                {receiverType == '1' &&
                                    <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@1vsohw`} span={rightCol} style={{ marginLeft: '43px' }}>
                                        <a href="/sms/batchFile/smsexcel.xls">{getLabel(519169, 'Excel导入模板')}</a>
                                    </Col>
                                }
                                {receiverType == '2' &&
                                    <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@fptnqu`} span={rightCol} style={{ marginLeft: '43px' }}>
                                        <a onClick={() => this.downloadTxt()} >{getLabel(519170, 'TXT导入模板')}</a>
                                    </Col>
                                }
                            </Row>
                            {receiverType == '1' && <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@9be0vg`} className="group-excel" style={{ marginBottom: '10px' }}>
                                <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@gqax9w`} offset={offset} span={leftCol} style={{ ...comStyle, lineHeight: '28px' }}>{getLabel(519171, '上传短信接收人')} :
                                </Col>
                                <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@p3v0ay`} span={11} style={{ marginLeft: '43px', marginTop: '3px' }} >
                                    <div style={{ float: 'left', marginTop: -10 }}>
                                        <WeaUpload ecId={`${this && this.props && this.props.ecId || ''}_WeaUpload@j66nbl`}
                                          uploadUrl="/api/doc/upload/uploadFile"
                                          category="string"
                                          limitType="xls"
                                          maxFilesNumber={1}
                                          datas={filelist}
                                          onChange={
                                                (ids, list) => {
                                                    this.setFileId(ids, list);
                                                }
                                            }
                                        >
                                            <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@5ueh5y`}>{filelist.length == 0 ? getLabel(125333, '选择文件') : getLabel(519172, '已选择文件')}</Button>
                                        </WeaUpload>
                                    </div>
                                    <div style={{ float: 'left', paddingLeft: 10 }}>
                                        {filelist.length == 0 ? <p>{getLabel(384040, '未选择任何文件')}</p> : filelist.map(file => <p>{file.filename}</p>)}
                                    </div>
                                </Col>
                            </Row>}
                            {receiverType == '2' && <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@typbgn`} className="group-excel" style={{ marginBottom: '10px' }}>
                                <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@4ynvqc`} offset={offset} span={leftCol} style={{ ...comStyle, lineHeight: '28px' }}>{getLabel(519171, '上传短信接收人')} :
                                </Col>
                                <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@9rqroy`} span={11} style={{ marginLeft: '43px', marginTop: '3px' }} >
                                    <div style={{ float: 'left', marginTop: -10 }}>
                                        <WeaUpload ecId={`${this && this.props && this.props.ecId || ''}_WeaUpload@efv9b1`}
                                          uploadUrl="/api/doc/upload/uploadFile"
                                          category="string"
                                          limitType="txt"
                                          maxFilesNumber={1}
                                          datas={filelist}
                                          onChange={
                                                (ids, list) => {
                                                    this.setFileId(ids, list);
                                                }
                                            }
                                        >
                                            <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@2u1o7h`}>{filelist.length == 0 ? getLabel(125333, '选择文件') : getLabel(519172, '已选择文件')}</Button>
                                        </WeaUpload>
                                    </div>
                                    <div style={{ float: 'left', paddingLeft: 10 }}>
                                        {filelist.length == 0 ? <p>{getLabel(384040, '未选择任何文件')}</p> : filelist.map(file => <p>{file.filename}</p>)}
                                    </div>
                                </Col>
                            </Row>}
                            {receiverType == '2' && <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@vne2sm`} className="" style={{ marginBottom: `${marginBottomValue}px` }}>
                                <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@78obsi`} offset={offset} span={titlecol} style={{ ...comStyle, paddingTop: `${marginBottomValue}px` }}>
                                    <span >{getLabel(18529, '短信内容')}: </span>
                                </Col>
                                <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@5r3dws`} span={fieldcol} style={{ marginLeft: '43px' }}>
                                    <div className="msg-tool"><div style={{ marginTop: '5px', display: 'inline-block' }}>{getLabel(20074, '你已输入')} {smsBatchImportStore.msgCount || 0} {getLabel(20075, '个字符')}</div>
                                        <div style={{ float: 'right', marginTop: '5px', marginRight: '20px', display: 'inline-block' }}>
                                            <div style={{ display: 'inline-block' }}>
                                                <div className="temp-btn" onClick={this.showTemp}>
                                                    {getLabel(28049, '短信模板')}
                                                </div>
                                                <div className="temp-content" style={contentStyle}>
                                                    <div className="arrow1" />
                                                    <div className="arrow2" />
                                                    <div className="temp-list">
                                                        {smsBatchImportStore.groups.length > 0 &&
                                                            <WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@2vbc8b`} height={120}>
                                                                <ul>
                                                                    {
                                                                        smsBatchImportStore.groups.map(item => (<li onClick={this.checkTemp.bind(this, item)}>
                                                                                <span>{item.title}</span>
                                                                            </li>))
                                                                    }
                                                                </ul>
                                                            </WeaNewScroll>
                                                        }
                                                    </div>

                                                    <div className="temp-foot-btn" title={getLabel(611, '添加')} onClick={this.doAdd} >
                                                        <Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@7gotcw`} type="plus-circle-o" />
                                                    </div>

                                                </div>
                                            </div>
                                            <div className="icon-coms-currency setting-btn" title={getLabel(518871, '短信模板维护')} onClick={this.openTempList} />
                                        </div>
                                    </div>
                                    <WeaTextarea ecId={`${this && this.props && this.props.ecId || ''}_WeaTextarea@ilnm85`} viewAttr={3} ref="textArea" minRows={8} value={smsBatchImportStore.msg || ''} onChange={value => this.onChange(value, 'msg')} />
                                </Col>
                            </Row>}
                            {smsBatchImportStore.showReply && receiverType == '2' && (
                                <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@vlx1cv`} className="tip-msg" style={{ marginBottom: '10px' }}>
                                    <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@ay7r2g`} offset={offset} span={titlecol} style={{ ...comStyle, paddingTop: `${marginBottomValue}px` }} />
                                    <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@i8brt1`} span={fieldcol} style={{ marginLeft: '43px' }}>
                                    <div style={{ display: 'flex', display: '-webkit-flex' }}>
                                        <span style={{ width: '100%' }}>{getLabel(384501, '回复方法：回复 ID+R+回复内容 （ID从收到的短信中可以获得')}</span><br />
                                    </div>
                                    <div style={{ display: 'flex', display: '-webkit-flex' }}>
                                        <span style={{ width: '10%' }}>{getLabel(520525, '例如：')} </span><br />
                                        <span style={{ width: '90%' }}> {getLabel(520523, '收到短信为：收到的消息内容(86)')} </span><br />
                                    </div>
                                    <div style={{ display: 'flex', display: '-webkit-flex' }}>
                                        <span style={{ width: '10%' }} />
                                        <span style={{ width: '90%' }}> {getLabel(520524, '回复应该为：86R 发送的消息内容')}</span>
                                    </div>
                                    </Col>
                                </Row>)}
                            <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@t6wlqp`} className="" style={{ marginBottom: `${marginBottomValue}px` }}>
                                <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@jl3nmd`} offset={offset} span={titlecol} style={{ ...comStyle, lineHeight: '32px' }}>
                                    <span >{getLabel(32028, '定时发送')}: </span>
                                </Col>
                                <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@6ql4vo`} span={fieldcol} style={{ marginLeft: '43px' }}>
                                    <div className={'regularChk'}>
                                        <WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@4cte62`}
                                          id={'regularChk'}
                                          display={'switch'}
                                          value={this.state.regularChk}
                                          onChange={(value) => {
                                                this.setState({ regularChk: value, regularDateTime: moment().format('YYYY-MM-DD HH:mm') });
                                            }}
                                        />
                                        {this.state.regularChk == 1 && <WeaDatePicker ecId={`${this && this.props && this.props.ecId || ''}_WeaDatePicker@i2hy6v`}
                                          viewAttr={3}
                                          showTime={{ format: 'HH:mm' }}
                                          format="yyyy-MM-dd HH:mm"
                                          value={this.state.regularDateTime}
                                          onChange={value => this.setState({ regularDateTime: value })}
                                        />}
                                    </div>
                                </Col>
                            </Row>
                        </div>
                    </Collapse>
                    {receiverType == '1' && <Collapse ecId={`${this && this.props && this.props.ecId || ''}_Collapse@43rkan`}
                      title={getLabel(128884, '导入说明')}
                      showGroup={true}
                    >
                        <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@fao94g`}>
                            <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@s4ovf9`} span={2} offset={4} style={{ ...comStyle, marginTop: 15 }}>
                                <div style={this.getCircle()}>
                                    <div style={{ paddingTop: 2, fontSize: '12px' }}>{1}</div>
                                </div>
                            </Col>
                            <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@8okx10`} span={17} style={{ marginTop: 15 }}>
                                <p>{getLabel(519161, '下载导入模板')}&nbsp;&nbsp;&nbsp;&nbsp;<a href="/sms/batchFile/smsexcel.xls">{getLabel(519169, 'Excel导入模板')}</a></p>
                            </Col>
                        </Row>
                        <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@c7q9hq`}>
                            <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@qfy6nr`} span={2} offset={4} style={{ ...comStyle, marginTop: 15 }}>
                                <div style={this.getCircle()}>
                                    <div style={{ paddingTop: 2, fontSize: '12px' }}>{2}</div>
                                </div>
                            </Col>
                            <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@2yqr89`} span={17} style={{ marginTop: 15 }}>
                                <p>{getLabel(519162, '填写模板数据后将文件上传。')}</p>
                            </Col>
                        </Row>
                        <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@ud71nk`}>
                            <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@p3fy2q`} span={2} offset={4} style={{ ...comStyle, marginTop: 15 }}>
                                <div style={this.getCircle()}>
                                    <div style={{ paddingTop: 2, fontSize: '12px' }}>{3}</div>
                                </div>
                            </Col>
                            <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@ed61d0`} span={17} style={{ marginTop: 15 }}>
                                <p>{getLabel(519163, 'Excel导入模板支持填写电话号码和短信内容导入；输入电话号码后，短信内容不能为空。')} </p>
                            </Col>
                        </Row>
                        <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@vcth18`}>
                            <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@s9v0xc`} span={2} offset={4} style={{ ...comStyle, marginTop: 15 }}>
                                <div style={this.getCircle()}>
                                    <div style={{ paddingTop: 2, fontSize: '12px' }}>{4}</div>
                                </div>
                            </Col>
                            <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@eqi2jr`} span={17} style={{ marginTop: 15 }}>
                                <p>{getLabel(519164, 'Excel导入模板中，电话号码和短信内容必须填入导入模板的第2个sheet中，模板中第一行为固定行，不能填写电话号码，数据从第二行算起； 电话号码一行一个，并输入对应发送短信内容。')} </p>
                            </Col>
                        </Row>
                    </Collapse>}
                    {receiverType == '2' && <Collapse ecId={`${this && this.props && this.props.ecId || ''}_Collapse@5io8wu`}
                      title={getLabel(128884, '导入说明')}
                      showGroup={true}
                    >
                        <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@ap34w8`}>
                            <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@rzl0cj`} span={2} offset={4} style={{ ...comStyle, marginTop: 15 }}>
                                <div style={this.getCircle()}>
                                    <div style={{ paddingTop: 2, fontSize: '12px' }}>{1}</div>
                                </div>
                            </Col>
                            <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@jvav6j`} span={17} style={{ marginTop: 15 }}>
                                <p>{getLabel(519161, '下载导入模板')}&nbsp;&nbsp;&nbsp;&nbsp;<a onClick={() => this.downloadTxt()} >{getLabel(519170, 'TXT导入模板')}</a></p>
                            </Col>
                        </Row>
                        <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@sn1g02`}>
                            <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@ozqu6d`} span={2} offset={4} style={{ ...comStyle, marginTop: 15 }}>
                                <div style={this.getCircle()}>
                                    <div style={{ paddingTop: 2, fontSize: '12px' }}>{2}</div>
                                </div>
                            </Col>
                            <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@4v8705`} span={17} style={{ marginTop: 15 }}>
                                <p>{getLabel(519162, '填写模板数据后将文件上传。')}</p>
                            </Col>
                        </Row>
                        <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@dh90gp`}>
                            <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@c47xvb`} span={2} offset={4} style={{ ...comStyle, marginTop: 15 }}>
                                <div style={this.getCircle()}>
                                    <div style={{ paddingTop: 2, fontSize: '12px' }}>{3}</div>
                                </div>
                            </Col>
                            <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@oh7zfr`} span={17} style={{ marginTop: 15 }}>
                                <p>{getLabel(519193, 'TXT导入模板中，仅仅支持电话号码导入。')}</p>
                            </Col>
                        </Row>
                        <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@s5n6pj`}>
                            <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@f1igr6`} span={2} offset={4} style={{ ...comStyle, marginTop: 15 }}>
                                <div style={this.getCircle()}>
                                    <div style={{ paddingTop: 2, fontSize: '12px' }}>{4}</div>
                                </div>
                            </Col>
                            <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@rmq33i`} span={17} style={{ marginTop: 15 }}>
                                <p>{getLabel(519166, 'TXT导入模板中，每个电话号码要通过“,”或“ ;" 隔开添加，或每个电话号码隔行添加。')} </p>
                            </Col>
                        </Row>
                    </Collapse>}
                </Spin>
            </div>
        );
    }

    downloadTxt = () => {
        const { smsBatchImportStore: { downloadTxt } } = this.props;
        downloadTxt();
    }

    getRightMenu() {
        const { loading } = this.props.smsBatchImportStore;
        let btns = [];
        btns.push({
            key: '0',
            icon: <i className="icon-coms-Approval" />,
            disabled: loading,
            content: getLabel(517319, '批量发送'),
        });
        return btns;
    }

    // 右键菜单事件绑定
    onRightMenuClick(key) {
        const { receiverType, regularChk, regularDateTime, excelfile } = this.state;
        const { smsBatchImportStore } = this.props;
        const { smsBatchImportStore: { createSmsBatch, smsBatchCheck } } = this.props;
        const { setLoading, msg } = smsBatchImportStore;
        let param = { receiverType, msg, regularChk, regularDateTime, fileId: excelfile };
        setLoading(true);
        if (!excelfile) {
            AlertModal(getLabel(516220, '请选择文件！'));
            setLoading(false);
            return;
        }
        if (receiverType == '2' && !msg) {
            AlertModal(getLabel(384506, '短信内容不能为空！'));
            setLoading(false);
            return;
        }
        if (regularChk == '1' && !regularDateTime) {
            AlertModal(getLabel(506448, '定时发送时间不能为空！'));
            setLoading(false);
            return;
        }
        smsBatchCheck(param, () => { setLoading(false); }, this.clearInfo);
    }

    clearInfo = () => {
        const params = {
            filelist: [],
            excelfile: '',
        };
        const { setMsg } = this.props.smsBatchImportStore;
        this.setState({ ...params });
    }

    getTopButtons() {
        const { loading } = this.props.smsBatchImportStore;
        let btns = [<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@n1cop5@$getTopButtons_batchSendBtn`} type="primary" disabled={loading} onClick={() => { this.onRightMenuClick(0); }}>{getLabel(517319, '批量发送')}</Button>];
        return btns;
    }

    pageClick = () => {
        if (this.state.clickFlag) {
            if (this.state.showTemp) {
                this.setState({ showTemp: false });
            }
        }
        this.setState({ clickFlag: true });
    }

    onChange = (values, type) => {
        if (type == 'msg') {
            const { smsBatchImportStore } = this.props;
            smsBatchImportStore.setMsg(values);
        } else {
            this.setState({ [type]: values });
        }
    }

    render() {
        const { smsBatchImportStore } = this.props;
        if (smsBatchImportStore.hasRight === '1') {
            return (
                <div className="sms-editSms" style={{ height: '100%' }} onClick={this.pageClick.bind(this)} ttt={smsBatchImportStore.showReply}>
                    <SmsTempList ecId={`${this && this.props && this.props.ecId || ''}_SmsTempList@fwks7q`}
                      visible={smsBatchImportStore.showFlag}
                      doRefresh={this.doRefresh}
                      doClose={() => {
                            smsBatchImportStore.closeTempList();
                        }}
                    />
                    <WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@tdkshy`}
                      title={getLabel(519173, '批量导入发送短信')}
                      loading={false}
                      icon={<i className="icon-coms-message" />}
                      iconBgcolor="#0079de"
                      buttons={this.getTopButtons()}
                      showDropIcon={true}
                      dropMenuDatas={this.getRightMenu()}
                      onDropMenuClick={this.onRightMenuClick.bind(this)}
                    >
                        <WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@p1myyr`} datas={this.getRightMenu()} onClick={this.onRightMenuClick.bind(this)}>
                            {this.getBatchImport()}
                        </WeaRightMenu>
                    </WeaTop>
                    <ImportResult ecId={`${this && this.props && this.props.ecId || ''}_ImportResult@3che06`} />
                </div>
            );
        } else if (smsBatchImportStore.hasRight === '0') {
			return (
				<WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@7dy89e`} top={'36%'}>
					<div>
                        {getLabel(2012, '对不起，您暂时没有权限！')}
					</div>
				</WeaAlertPage>
			);
		}
			return (
				<div />
			);
    }

    setFileId(ids, list) {
        this.setState({ excelfile: ids, filelist: list });
    }

    doRefresh = () => {
        const { smsBatchImportStore } = this.props;
        smsBatchImportStore.getOptions();
    }
}

export default SmsBatchImport;

